<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>sun dog</title>
    <script src="jquery.js"></script>
    <script language="javascript">
        document.onkeyup = function (e) {
            var code = e.charCode || e.keyCode;
            if (code == 13) {
                say();
            }
        };

        function say() {
            say_text = $("#say").val();
            $.post("wa.php", {say: say_text}, function (data) {
                $("#answer").html(data.answer);
            }, 'json');
        }

    </script>
</head>
<body>
<span id="answer">我是一个正常的聊天工具</span><br/>

<input type="text" placeholder="what do you want to say?" id="say"/>


</body>
</html>